package dao.impl;

import dao.Action;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.PrintWriter;

public class ActionOutLoginImpl implements Action {
    /**
     * 执行方法
     *
     * @param request
     * @param response
     * @throws Exception
     */
    @Override
    public void execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
        request.setCharacterEncoding("UTF-8");
        PrintWriter out = response.getWriter();
        HttpSession session=request.getSession();
        session.invalidate();
        Cookie[] cookie=request.getCookies();
        cookie.clone();
        out.print("out");
        out.flush();
        out.close();
    }
}
